package metrics_sql

const (
	K8sContainerMemUsageV2 = `
guid = "%v"
container = /^(%v)$/

from(bucket: "data")
  |> range(start: %v, stop: %v)
  |> filter(fn: (r) => r["_measurement"] == "prometheus_remote_write")
  |> filter(fn: (r) => r["_field"] == "metrics")
  |> filter(fn: (r) => r["name"] == "container_memory_used_bytes")
  |> filter(fn: (r) => r["namespace"] == guid)
  |> filter(fn: (r) => r["container"] =~ container)

`
	K8sContainerMemUsagelastV2 = `
guid = "%v"
container = /^(%v)$/

from(bucket: "data")
  |> range(start: %v, stop: %v)
  |> filter(fn: (r) => r["_measurement"] == "prometheus_remote_write")
  |> filter(fn: (r) => r["_field"] == "metrics")
  |> filter(fn: (r) => r["name"] == "container_memory_used_bytes")
  |> filter(fn: (r) => r["namespace"] == guid)
  |> filter(fn: (r) => r["container"] =~ container)
  |> last()
`
	GluenetContainerMemUsageV2 = `
containerRegex = /%v_(%v)+/

from(bucket: "data")
  |> range(start: %v, stop: %v)
  |> filter(fn: (r) => r["_measurement"] == "prometheus_remote_write")
  |> filter(fn: (r) => r["_field"] == "container_memory_usage_bytes")
  |> filter(fn: (r) => r["name"] =~ name)
`
	GluenetContainerMemUsagelastV2 = `
containerRegex = /%v_(%v)+/

from(bucket: "data")
  |> range(start: %v, stop: %v)
  |> filter(fn: (r) => r["_measurement"] == "prometheus_remote_write")
  |> filter(fn: (r) => r["_field"] == "container_memory_usage_bytes")
  |> filter(fn: (r) => r["name"] == name)
  |> last()
`
)
